package com.hjb.toolbardemo.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.hjb.toolbardemo.R;
import com.hjb.toolbardemo.base.BaseRecyclerViewHolder;
import com.hjb.toolbardemo.base.RecyclerBaseAdapter;
import com.hjb.toolbardemo.bean.Car;

import java.util.List;

import butterknife.ButterKnife;
import butterknife.InjectView;

/**
 * 作者 : hjb
 * 时间 : 2016/5/12.
 */
public class HomeRecycleAdapter extends RecyclerBaseAdapter {

    public HomeRecycleAdapter(Context context, List data) {
        super(context, data);
    }

    @Override
    public View getItemView() {
        return mInflater.inflate(R.layout.item_home_adapter, null);
    }

    @Override
    public int getItemCount() {
        return 10;
    }

    @Override
    protected void onBindViewHolder_(BaseRecyclerViewHolder holder, int position) {
        ViewHolder viewHolder = new ViewHolder(rootView);
//        Car car = (Car) data.get(position);
//        viewHolder.mText.setText(car.getName());
//        Glide.with(context)
//                .load(car.getImgUrl())
//                .fitCenter()
//                .placeholder(R.mipmap.ic_launcher)
//                .crossFade()
//                .into(viewHolder.mImage);
    }


    class ViewHolder extends BaseRecyclerViewHolder {
        @InjectView(R.id.image)
        ImageView mImage;
        @InjectView(R.id.text)
        TextView mText;

        ViewHolder(View view) {
            super(view);
            ButterKnife.inject(this, view);
        }
    }

}
